<template>
    <view :style="themeColor">
        <view class="page" >
    <view class="flex flex-wrap align-center justify-between benben-position-layout flex voucher_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
            <view   class='flex flex-wrap align-center voucher_fd0_0'   @tap="handleJumpDiy" data-type="redirectTo" :data-url="`/pages/wd/reviewSubmit/reviewSubmit`"   >
        <image class='voucher_fd0_0_c0'  mode="aspectFit"  :src='STATIC_URL+"234.png"'></image>
</view>
<text class='voucher_fd0_1'  >支付</text>
    <view   class='flex flex-wrap align-center voucher_fd0_0'      >
        </view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---填写支付信息flex布局开始-->
 <view class="flex flex-direction align-stretch benben-flex-layout voucher_flex_1"    >
            <view   class='flex align-center justify-between voucher_fd1_0'      >
        <text class='voucher_fd1_0_c0'  >{{$t('银行账号')}}</text>
<input class='flex-sub voucher_fd1_0_c1'   type="text" :placeholder="$t('请输入银行账号')" confirm-type="done" :maxlength="-1" :disabled='true' placeholder-style="color:#999;font-size:28rpx"  v-model="dataMessage.account_id" />
<text class='voucher_fd1_0_c2'     @tap.stop="copyText(dataMessage.account_id)" >复制</text>
</view>
    <view   class='flex align-center justify-between voucher_fd1_0'      >
        <text class='voucher_fd1_0_c0'  >{{$t('银行开户名')}}</text>
<input class='flex-sub voucher_fd1_0_c1'   type="text" :placeholder="$t('请输入银行开户行')" confirm-type="done" :maxlength="-1" :disabled='true' placeholder-style="color:#999;font-size:28rpx"  v-model="dataMessage.account_name" />
</view>
    <view   class='flex align-center justify-between voucher_fd1_0'      >
        <text class='voucher_fd1_0_c0'  >{{$t('开户银行所在地')}}</text>
<input class='flex-sub voucher_fd1_0_c1'   type="text" :placeholder="$t('请输入银行所在地')" confirm-type="done" :maxlength="-1" :disabled='true' placeholder-style="color:#999;font-size:28rpx"  v-model="dataMessage.bank_branch" />
</view>
    <view   class='flex align-center justify-between voucher_fd1_0'      >
        <text class='voucher_fd1_0_c0'  >{{$t('开户行')}}</text>
<input class='flex-sub voucher_fd1_0_c1'   type="text" :placeholder="$t('请输入开户行')" confirm-type="done" :maxlength="-1" :disabled='true' placeholder-style="color:#999;font-size:28rpx"  v-model="dataMessage.bank_address" />
</view>
    <view   class='flex align-center justify-between voucher_fd1_0'      >
        <text class='voucher_fd1_0_c0'  >{{$t('打款金额')}}</text>
<input class='flex-sub voucher_fd1_0_c1'   type="text" :placeholder="$t('请输入打款金额')" confirm-type="done" :maxlength="-1" :disabled='true' placeholder-style="color:#999;font-size:28rpx"  v-model="dataMessage.money" />
<text class='voucher_fd1_4_c2'  >元</text>
</view>
    <view   class='flex align-center justify-between voucher_fd1_0'      >
        <text class='voucher_fd1_0_c0'  >{{$t('打款截图')}}</text>
<view class="upload position-relative">
    
     <image class=" voucher_fd1_5_c1_image" mode="aspectFit"  @tap="soloChooseImage('pay_img','pay_img',false,false)" :src="pay_img ? pay_img : STATIC_URL+'330.png'"></image>
</view>
</view>
    <view   class='flex align-center justify-between voucher_fd1_6'      >
        <text class='voucher_fd1_0_c0'  >{{$t('打款备注')}}</text>
<input class='flex-sub voucher_fd1_0_c1'   type="text" :placeholder="$t('请输入打款备注')" confirm-type="done" :maxlength="-1" placeholder-style="color:rgba(153, 153, 153, 1);font-size:28rpx"  v-model="pay_remark" />
</view>
    <view   class='flex flex-wrap align-start justify-center voucher_fd1_7'      >
        <button class='voucher_fd1_7_c0'  @tap="handleJumpDiy" data-type="redirectTo" :data-url="`/pages/wd/reviewSubmit/reviewSubmit`"  >上一步</button>
<button class='voucher_fd1_7_c1'  @tap.stop="getPayFunc()"  >提交</button>
</view>
</view>
        
<!---填写支付信息flex布局结束-->
    
    
        </view>
    </view>
</template>
<script>
    import UploadImage from '@/common/utils/upload-image.js'
import {validate} from '@/common/utils/validate.js'
    export default {
        components:{},
        
        
        data(){
			return {"dataMessage":{"account_name":"","account_id":"","bank_branch":"","bank_address":"","money":"","aid":""},"pay_img":"","pay_remark":""};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            this.queryMessageFunc()
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                         //上传单图、多图方法
    soloChooseImage(id, path, obj, obj1, fnName = false) {
      let self = this
      if (!obj) obj = this
      if (!obj1) obj1 = this
      if (self.uploading) {
        return
      }
      // 从相册中选择图片
      uni.chooseImage({
        count: 1, // 默认3
        sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
        success: function (res) {
          self.uploading = true
          // 开始上传
          new UploadImage(res.tempFiles, {
            complete: function (res) {
              self.uploading = false
              if (id) self.$set(obj, id, res[0].id)
              if (path) self.$set(obj1, path, res[0].path)
              if (fnName) self[fnName]()
            },
          })
        },
      })
    },
                //提交支付凭证
                async getPayFunc(){
                                if(!validate(this.pay_img,'require')){
                 this.$message.info('请上传打款截图');
                 return false;
            }
            if(!validate(this.pay_remark,'require')){
                 this.$message.info('请输入打款备注');
                 return false;
            }
    //请求方法
    //数据验证
    
  let data62be71b9abb23 = await this.$api.post(global.apiUrls.post62be71b9abb23, {
    pay_img:this.pay_img,pay_remark:this.pay_remark,aid:this.dataMessage.aid
  });
  
  if (data62be71b9abb23.data.code != 1) {
    this.$message.info(data62be71b9abb23.data.msg);
    return
  } 
  
  
  
    this.$urouter.redirectTo(`/pages/wd/reviewSubmit/reviewSubmit?store_joinin_id=`);
                },
                //商家入驻-获取打款信息
                async queryMessageFunc(){
                        //请求方法
    //数据验证
    
  let datadataMessage = await this.$api.get(global.apiUrls.post636f9a89c9680, {
    
  });
  
  if (datadataMessage.data.code != 1) {
    this.$message.info(datadataMessage.data.msg);
    return
  } 
  let infodataMessage = datadataMessage.data;
  this.dataMessage = infodataMessage.data
  
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:#F8F8F8;background-size: 100% auto;
        }
    .voucher_flex_0{
        background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
    }
    .voucher_fd0_1{
        color:#333333;font-size:36rpx;font-weight:500;line-height:50rpx;
    }
    .voucher_fd0_0_c0{
        width:20rpx;height:36rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 0rpx 0rpx 32rpx;
    }
    .voucher_fd0_0{
        width:100rpx;height:88rpx;
    }
    .voucher_flex_1{
        background:#fff;margin:24rpx 24rpx 118rpx 24rpx;padding:0rpx 24rpx 0rpx 24rpx;background-size:100% auto !important;border-radius:16rpx 16rpx 16rpx 16rpx;
    }
    .voucher_fd1_7_c1{
        background:var(--benbenbgColor7);border-radius:100rpx 100rpx 100rpx 100rpx;font-size:32rpx;color:var(--benbenFontColor3);width:328rpx;height:88rpx;line-height:88rpx;font-weight:500;margin:0rpx 0rpx 0rpx 32rpx;
    }
    .voucher_fd1_7_c0{
        border:1px solid var(--benbenbdColor0);background:var(--benbenbgColor1);border-radius:100rpx 100rpx 100rpx 100rpx;font-size:32rpx;color:var(--benbenFontColor5);width:328rpx;height:88rpx;line-height:88rpx;font-weight:500;
    }
    .voucher_fd1_7{
        background:rgba(248, 248, 248, 1);height:112rpx;background-size:100% auto !important;position:fixed;bottom:calc(0rpx + var(--window-bottom));left:0rpx;width:750rpx;
    }
    .voucher_fd1_6{
        padding:32rpx 0rpx 32rpx 0rpx;
    }
    .voucher_fd1_5_c1_image{
        width:160rpx;height:160rpx;border-radius:16rpx 16rpx 16rpx 16rpx;
    }
    .voucher_fd1_4_c2{
        color:#333333;font-size:28rpx;font-weight:500;line-height:40rpx;margin:0rpx 0rpx 0rpx 10rpx;
    }
    .voucher_fd1_0_c2{
        color:var(--benbenFontColor4);font-size:28rpx;font-weight:400;line-height:40rpx;margin:0rpx 0rpx 0rpx 24rpx;
    }
    .voucher_fd1_0_c1{
        text-align:right;font-size:28rpx;font-weight:400;color:#333;margin:0rpx 0rpx 0rpx 32rpx;
    }
    .voucher_fd1_0_c0{
        color:#333333;font-size:28rpx;font-weight:400;line-height:40rpx;
    }
    .voucher_fd1_0{
        border-bottom:1px solid #eee;padding:32rpx 0rpx 32rpx 0rpx;
    }
</style>